﻿using System.Configuration;

namespace DataObjects.Entity
{
    public static class EntityObjectFactory
    {
        private static readonly string ConnectionString;

        static EntityObjectFactory()
        {
            string connection = ConfigurationManager.AppSettings.Get("connection");
            ConnectionString = ConfigurationManager.ConnectionStrings[connection].ConnectionString;
        }

        public static NorthwindEntities CreateContext()
        {
            return new NorthwindEntities(ConnectionString);
        }
    }
}
